Timetable week: 15
Topic: "Presenting quantitative results"
The aim of this final week is to gain some practice in getting the various outputs we have produced as part of a statistical analysis onto “paper”, as part of the process of writing up our findings into a report.
In every quantitative analysis, we need to ensure that our analysis is open and reproducible. This is increasingly a professional standard expected of all data analysts in the social sciences. This means that we need to have an efficient way in which to share our analysis code and well as our outputs and our interpretations of our findings with our readers. This is also what the assignment requires.
RStudio has an efficient way of handling this
requirement with the use of the R markdown document
format, .Rmd (a more recent version of which
is the Quarto document type, .qmd,
but we’ll stick with .Rmd for now).
In fact, these worksheets themselves were written in
R Markdown, so you have already witnessed how the output
may look like: we have this text you are reading right now, and we can
also include and execute R code chunks such as this
one:
```{r}
# Let's first (install and) load the packages we want to use.
install.packages("tidyverse")
install.packages("mosaic")
install.packages("sjmisc")
install.packages("jtools")
library(tidyverse)
library(mosaic)
library(sjmisc)
library(jtools)
```
While one can do amazing things with .Rmd documents and
there are various settings that one can use to customise the output in
every way possible and in various output formats, we’ll only cover the
very basics that allow you to complete a full data analysis project
(such as your Assignment 2!!) in an .Rmd
document.
Instead of readings, you have some online training to complete this week:
And/or the following:
Further training:
For those interested in developing their R skills in
creating publishable-quality visualisations (graphs, figures)
Secondary readings:
.Rmd documentAbout 30 minutes
As usual, open the R Studio
interface by clicking on the
SOC2069-Statistical-analysis.Rproj file
included in the SOC2069-Statistical-analysis
project folder that you downloaded from Canvas in Lab6. The folder
should be stored on your Newcastle University OneDrive
and accessible from any computer
If you haven’t yet downloaded the project folder in TW11 (Lab6), then download it from Canvas.
Not as usual, instead of opening a new
R script for the session, open a new “R Markdown” document
and give it the Title “Rmd practice” in the pop-up window (you can also
add your name if you want, and the current date is included
automatically, but you can change or delete that if you want):
or
When you open a new R Markdown document from the Menu,
the document that opens up is actually a micro-tutorial showing you the
basic elements of the document format. Read through the included
information and then “knit” the document in both html and
Microsoft Word format to see the results:
To get a Microsoft Word document as output:
To get an HTML document as the output: